package com.example.dzcfinal.fragment;

import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.dzcfinal.R;

import java.util.List;

public class AddFragment extends Fragment {

    private LinearLayout zhan;
    private List<com.example.dzcfinal.SQLite.Goods> Goods;
    private LinearLayout one;
    private LinearLayout two;
    private TextView NameOne;
    private TextView NameTwo;
    private TextView give_one;
    private TextView give_two;
    private String NameOneText;
    private String NameTwoText;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view  =  inflater.inflate(R.layout.fragment_add, container, false);
//        initHandle(view);


        return view;
    }
//
//    private void initHandle(View view){
//        one = view.findViewById(R.id.one);
//        two = view.findViewById(R.id.two);
//        NameOne = view.findViewById(R.id.NameOne);
//        NameTwo = view.findViewById(R.id.NameTwo);
//        give_one = view.findViewById(R.id.give_one);
//        give_two = view.findViewById(R.id.give_two);
//        NameOneText = NameOne.getText().toString();
//        NameTwoText = NameTwo.getText().toString();
//        //        初始控件为不可见
//        one.setVisibility(View.GONE);
//        two.setVisibility(View.GONE);
//    }
//
//    private void GiveOne(String nameOneText) {
//        give_one.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                SQLite sql = new SQLite(this);
//                sql.deleteGood(nameOneText);
//                one.setVisibility(View.GONE);
//            }
//        });
//    }
//
//    private void GiveTwo(String nameTwoText) {
//        give_two.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                SQLite sql = new SQLite(this);
//                sql.deleteGood(nameTwoText);
//                two.setVisibility(View.GONE);
//            }
//        });
//    }
//
//    private void judgeOne(String Text) {
//        SQLite sql = new SQLite((View.OnClickListener) this);
//        if (sql.findGood(Text)!=-1){
//            one.setVisibility(View.VISIBLE);
//        }
//    }
//
//    private void judgeTwo(String Text) {
//        SQLite sql = new SQLite((View.OnClickListener) this);
//        if (sql.findGood(Text)!=-1){
//            two.setVisibility(View.VISIBLE);
//        }
//    }

}